home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 1 / csmp-v1-196.txt < prev    next >
Text File  |  1992-12-31  |  43KB  |  1,225 lines

  1. C.S.M.P. Digest             Thu, 22 Oct 92       Volume 1 : Issue 196
  2.  
  3. Today's Topics:
  4.  
  5.     Free Code:  Watch Cursors
  6.     More free code:  Simplifying the List Manager
  7.     Need sample code of MPW tool using Apple Events
  8.     What is the bandwidth of a CableTV channel?
  9.     PaintBehind (was Re: NON-QUICKDRAW GAMES)
  10.     List fields...
  11.     Color Icons
  12.  
  13.  
  14.  
  15. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  16.  
  17. The digest is a collection of article threads from the internet newsgroup
  18. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  19. regularly and want an archive of the discussions.  If you don't know what a
  20. newsgroup is, you probably don't have access to it.  Ask your systems
  21. administrator(s) for details.  (This means you can't post questions to the
  22. digest.)
  23.  
  24. Each issue of the digest contains one or more sets of articles (called
  25. threads), with each set corresponding to a 'discussion' of a particular
  26. subject.  The articles are not edited; all articles included in this digest
  27. are in their original posted form (as received by our news server at
  28. cs.uoregon.edu).  Article threads are not added to the digest until the last
  29. article added to the thread is at least one month old (this is to ensure that
  30. the thread is dead before adding it to the digest).  Article threads that
  31. consist of only one message are generally not included in the digest.
  32.  
  33. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  34. [128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
  35. file /pub/mac/csmp-digest/README before downloading any files.  The most
  36. recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
  37. directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
  38. archive has a mail server; send a message with the text '$MACarch help' (no
  39. quotes) to LISTSERV@ricevm1.rice.edu for more information.
  40.  
  41. The digest is also available via email.  Just send a note saying that you
  42. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  43. automatically receive each new issue as it is created.  Sorry, back issues
  44. are not available through the mailing list.
  45.  
  46. Send administrative mail to mkelly@cs.uoregon.edu.
  47.  
  48.  
  49. -------------------------------------------------------
  50.  
  51. From: kurisuto@BACH.UDEL.EDU ("Sean J. Crist")
  52. Subject: Free Code:  Watch Cursors
  53. Date: 18 Sep 92 02:30:01 GMT
  54.  
  55.  
  56.      The following free code is nothing particularly complicated or
  57. unusual; it simply handles the work involved in showing watch cursors,
  58. either with spinning or non-spinning hands.  I'm posting it here because
  59. it may be helpful to new programmers, or
  60. because it might save someone else the time of writing it over again.
  61.      This code was written in Think Pascal 4.0.
  62.  
  63. How to use this code:
  64. 1.  Use ResEdit to copy the seven CURS resources from the Finder into your
  65. application's resource file.  I lifted mine from 6.1.5 where they were
  66. numbered beginning at 257.  I'm not sure whether or not these resource
  67. numbers are the same under all
  68. versions of the Finder; if yours are different, you will have to either
  69. change the resource numbers or the code below.
  70.      Also, I don't know how Apple feels about people stealing their
  71. cursors.  However, since these seven CURS resources are a standard part of
  72. the user interface, and since they are a minor part of the Finder, I doubt
  73. that Apple is going to sue you for
  74. using them.
  75.  
  76. 2.  Include the global variables in the code below in your program's
  77. global declarations.
  78.  
  79. 3.  When your program initializes itself on startup, it should call
  80. InitWatch once.  Alternately, you could eliminate this routine and paste
  81. its one line of code into your own initialize routine.
  82.  
  83. 4.  To show a simple still watch, call ShowWatch.  This routine is
  84. functionally equivalent to InitCursor.
  85.  
  86. 5.  To make the hands of the watch actually spin, don't call ShowWatch. 
  87. Instead, start the watch spinning by calling StartSpinningWatch.  While
  88. you are doing your time-consuming processing, call SpinWatch as often as
  89. possible (perhaps by including it in
  90. some inner processing loop).  SpinWatch takes care of the timing involved
  91. in spinning the watch hands; all you have to do is call it as often as
  92. possible.
  93.  
  94. 6.  When you are finished spinning the watch hands, be sure to call
  95. StopSpinningWatch.  This deallocates the memory associated with the watch
  96. cursors.
  97.  
  98. 7.  This code spins the watch handle every 30 ticks (once every half
  99. second).  To change this speed, edit the figure 30 in the SpinWatch
  100. routine.  (I don't know whether Apple has established any guideline for
  101. how often a cursor should spin.)
  102.  
  103. Please send bug reports, praise, etc. to kurisuto@bach.udel.edu.  I hope
  104. this code is useful to somebody.
  105.  
  106. unit SpinningWatch;
  107.  
  108. interface
  109.  
  110. {Global variables}
  111.  var
  112.   gWatchHandle: CursHandle;
  113.   gSpinningWatchHandle: array[1..8] of CursHandle;
  114.   gSpinningWatchTimer: LongInt;
  115.   gSpinningWatchState: Integer;
  116.  
  117. {Call this at the beginning of your program.}
  118.  procedure InitWatch;
  119.  
  120. {Call ShowWatch as you would InitCursor.}
  121.  procedure ShowWatch;
  122.  
  123. {This routine is called when we want to first start displaying the moving
  124. watch cursor.}
  125.  procedure StartSpinningWatch;
  126.  
  127. {This routine is called when we want to rotate the watch to the next
  128. position.  We should}
  129. {just call this routine as often as possible; this routine worries about
  130. the timing itself.}
  131.  procedure SpinWatch;
  132.  
  133. {This routine deallocates the memory we used and inits the cursor.}
  134.  procedure StopSpinningWatch;
  135.  
  136. implementation
  137.  
  138.  procedure InitWatch;
  139.  begin
  140. {Get a handle to that standard watch cursor and hold on to it for the rest
  141. of the program.}
  142.   gWatchHandle := GetCursor(WatchCursor);
  143.  end;
  144.  
  145.  
  146.  procedure ShowWatch;
  147. {Set cursor to watch}
  148. {We have no routine ShowPointer, because we can simply say InitCursor.}
  149.  begin
  150.   SetCursor(gWatchHandle^^);
  151.  end;
  152.  
  153. {This routine is called when we first start want to display the moving
  154. watch cursor.}
  155.  procedure StartSpinningWatch;
  156.   var
  157.    counter: Integer;
  158.  begin
  159.   for counter := 1 to 7 do
  160.    gSpinningWatchHandle[counter] := GetCursor(Counter + 256);
  161.   gSpinningWatchState := 8;
  162.   gSpinningWatchTimer := TickCount;
  163.  end;
  164.  
  165. {This routine is called when we want to rotate the watch to the next
  166. position.  We should}
  167. {just call this routine as often as possible; this routine worries about
  168. the timing.}
  169.  procedure SpinWatch;
  170.   var
  171.    NewTime: LongInt;
  172.  begin
  173.   NewTime := TickCount;
  174.   if (NewTime - 30) > gSpinningWatchTimer then
  175.    begin
  176.     gSpinningWatchState := gSpinningWatchState + 1;
  177.     gSpinningWatchTimer := NewTime;
  178.     if gSpinningWatchState > 8 then
  179.      gSpinningWatchState := 1;
  180.     if gSpinningWatchState = 8 then
  181.      ShowWatch
  182.     else
  183.      SetCursor(gSpinningWatchHandle[gSpinningWatchState]^^);
  184.    end;
  185.  end;
  186.  
  187. {This routine deallocates the memory we used and inits the cursor.}
  188.  procedure StopSpinningWatch;
  189.   var
  190.    counter: Integer;
  191.  begin
  192.   for counter := 1 to 7 do
  193.    ReleaseResource(Handle(gSpinningWatchHandle[counter]));
  194.  end;
  195.  
  196. end.
  197.  
  198.  
  199.  
  200.  
  201. ---------------------------
  202.  
  203. From: kurisuto@BACH.UDEL.EDU ("Sean J. Crist")
  204. Subject: More free code:  Simplifying the List Manager
  205. Date: 18 Sep 92 03:33:13 GMT
  206.  
  207.  
  208.      The following code, once again, is nothing particularly glamorous; it
  209. simply makes it easier to use the List Manager to create and manage lists
  210. of strings.  One of the most common uses for the List Manager is
  211. scrollable, one-dimensional, fixed-size
  212. lists of strings (as in SFGetFile, SFPutFile).  The List Manager is good
  213. for creating all kinds of lists (such as lists of icons), but a lot of
  214. this functionality is a hassle for programmers who only need a simple list
  215. of strings.
  216.      The code below allows you create and dispose of lists of strings.  It
  217. allows you to add, rename, and remove elements in the list, and handles
  218. mouse clicks and update events.  It also keeps the lists in alphabetical
  219. order.
  220.      I remember having a lot of trouble learning how to call the List
  221. Manager properly; I hope that this code helps somebody else.
  222.  
  223. How to use these routines:
  224.      Every one of these routines takes a ListHandle as one of its
  225. parameters.  It is OK to have several lists going at one time; just make
  226. sure you pass the right ListHandle when you call one of these routines.
  227.      
  228. CreateList:  Call this routine to create a new list of strings.  Pass it
  229. an empty ListHandle, as well as the pointer to the window to contain the
  230. list, and the rectangle in which the list should be enclosed.  The list
  231. can take up an entire window, or only
  232. part of it, as you prefer.  The scroll bar will be drawn inside the
  233. rectangle you specify, so you don't need to leave extra room for it. 
  234. Initially, the list will contain no strings.
  235.  
  236. UpdateList:  Call this in response to an Update event to redraw the
  237. portions of the list which need it.  This routine assumes that you have
  238. already called BeginUpdate for the window containing the list, and that
  239. you have not yet called EndUpdate.
  240.  
  241. DoClick:  Call this function in response to a MouseDown event inside your
  242. list's rectangle.  DoClick usually returns FALSE, but it returns TRUE if
  243. this click is the second click of a double-click (i.e., TRUE means the
  244. user double-clicked an item).
  245.  
  246. TurnOffSelection:  This routine unhilights the currently hilighted cell,
  247. if any.
  248.  
  249. ListSelection:  This returns the string of the currently selected cell. 
  250. If no cell is currently selected, the empty string is returned.
  251.  
  252. AddCell:  Call this routine to add a new cell to the list.  The string you
  253. pass to this routine is automatically alphabetized within the list.  Bug
  254. alert:  the first element or two of the list are sometimes not in
  255. alphabetical order.  If you take the time
  256. to work out this kink, please let me know what you did (I could figure
  257. this out, but I just haven't taken the time to).  This bug is cosmetic and
  258. does not crash the program.
  259.  
  260. RenameCell:  Changes the string in a cell to another string, and
  261. realphabetizes the list, if necessary.  
  262.  
  263. DeleteCell:  Removes the cell with the given string from the list.
  264.  
  265. DisposList:  Call this routine when you are completely finished with a
  266. list and want to deallocate its memory.
  267.  
  268.      Credit: The routines CreateList, UpdateList, DoClick, and DisposList
  269. are loosely based on some code I received from somebody of
  270. comp.sys.mac.programmer around two years ago.  I've rewritten these
  271. routines, but credit is due to this contributor, whose
  272. name I cannot remember.
  273.  
  274.      I have successfully called these routines for lists in regular
  275. windows as well as in modal dialogs.  Please send bug reports, praise,
  276. money, etc. to kurisuto@bach.udel.edu.
  277.  
  278. unit StringListInterface;
  279.  
  280. interface
  281.  
  282. {Create a new list with no elements.}
  283.  procedure CreateList (var TheListHandle: ListHandle; TheWindow:
  284. WindowPtr; TheRect: Rect);
  285.  
  286. {Update the art of a list.}
  287.  procedure UpdateList (TheListHandle: ListHandle);
  288.  
  289. {Handle a click in the list rectangle.  If it was a double-click, we will
  290. return TRUE.}
  291.  function DoClick (TheListHandle: ListHandle; TheWhere: Point): Boolean;
  292.  
  293. {Turn off any hilited item.}
  294.  procedure TurnOffSelection (TheListHandle: ListHandle);
  295.  
  296. {Return the string currently selected; empty string if no selection.}
  297.  function ListSelection (TheListHandle: ListHandle): string;
  298.  
  299. {Add a new cell containing the string parameter to the end of the list}
  300.  procedure AddCell (TheListHandle: ListHandle; NewString: str255);
  301.  
  302. {Change the name of an existing cell}
  303.  procedure RenameCell (TheListHandle: ListHandle; OldString, NewString:
  304. Str255);
  305.  
  306. {Remove the cell with the given name from the list.}
  307.  procedure DeleteCell (TheListHandle: ListHandle; TheString: string);
  308.  
  309. {Get rid of the list when we're done with it, cleaning up all the memory.}
  310.  procedure DisposList (TheListHandle: ListHandle);
  311.  
  312. implementation
  313.  
  314.  procedure CreateList;
  315.   const
  316.    StandardList = 0;
  317.   var
  318.    ViewRect: Rect;
  319.    DataBounds: Rect;
  320.    CellSize: Point;
  321.    TempInteger: Integer;  {Just to do a little math}
  322.  begin
  323. {Inset the box to make room for the scroll bar.  Also inset it so we've
  324. got room for a border.}
  325.   ViewRect := TheRect;
  326.   InsetRect(ViewRect, 1, 1);
  327.   ViewRect.Right := ViewRect.Right - 15;
  328. {Set the cell size to the size of the cell}
  329.   CellSize.v := TheWindow^.txSize + 3;
  330.   if CellSize.v = 3 then  {If it hasn't been set, then make it 12 point.}
  331.    begin
  332.     TextSize(12);
  333.     CellSize.v := 15;
  334.    end;
  335.   CellSize.h := ViewRect.Right - ViewRect.Left;
  336. {Now adjust the ViewRect to avoid cutting off the last visible cell}
  337.   TempInteger := (ViewRect.Bottom - ViewRect.Top) div CellSize.v;
  338.   ViewRect.Bottom := ViewRect.Top + (TempInteger * CellSize.v);
  339. {Create the new list.}
  340.   SetRect(DataBounds, 0, 0, 1, 0);
  341.   TheListHandle := LNew(ViewRect, DataBounds, CellSize, StandardList,
  342. TheWindow, FALSE, FALSE, FALSE, TRUE);
  343.   UpdateList(TheListHandle);
  344.  end;
  345.  
  346. {Update the display of a list.}
  347.  procedure UpdateList;
  348.   var
  349.    ViewRect: Rect;
  350.    ListUpdateRgn: RgnHandle;
  351.  begin
  352.   SetPort(TheListHandle^^.Port);
  353. {Get the List manager to update the list.}
  354.   ViewRect := TheListHandle^^.rView;
  355.   LDoDraw(true, TheListHandle);
  356.   ListUpdateRgn := NewRgn;
  357.   RectRgn(ListUpdateRgn, ViewRect);
  358.   LUpdate(ListUpdateRgn, TheListHandle);
  359. {Draw the border}
  360.   InsetRect(ViewRect, -1, -1);
  361.   FrameRect(ViewRect);
  362. {Clean up after ourselves}
  363.   DisposeRgn(ListUpdateRgn);
  364.  end;
  365.  
  366. {Handle a click in the list rectangle.  If it was a double-click, we will
  367. return TRUE.}
  368.  function DoClick;
  369.  begin
  370.   SetPort(TheListHandle^^.Port);
  371.   LDoDraw(TRUE, TheListHandle);
  372.   DoClick := LClick(TheWhere, 0, TheListHandle);
  373.  end;
  374.  
  375. {Turn off any hilited item.}
  376.  procedure TurnOffSelection;
  377.   var
  378.    ResultPoint: Point;
  379.  begin
  380.   SetPt(ResultPoint, 0, 0);
  381.   if LGetSelect(TRUE, ResultPoint, TheListHandle) then
  382.    LSetSelect(FALSE, ResultPoint, TheListHandle);
  383.  end;
  384.  
  385. {Return the string currently selected; empty string if no selection.}
  386.  function ListSelection;
  387.   var
  388.    ResultPoint: Point;
  389.    ResultString: Str255;
  390.    StringPointer: Ptr;
  391.    StringLength: Integer;
  392.  begin
  393.   SetPt(ResultPoint, 0, 0);
  394.   if LGetSelect(TRUE, ResultPoint, TheListHandle) then
  395. {If there is a cell selected, then get the string value of that string. 
  396. There ought to be an}
  397. {easier way to do this than mucking around in the memory like this.  >:-( 
  398.   }
  399.    begin  {If there is a cell selected, then return the string of the cell.}
  400.     StringPointer := Ptr(Ord(@ResultString) + 1);
  401.     StringLength := 255;  {This is the maximum amount of data we are
  402. allowed to move.}
  403.     LGetCell(StringPointer, StringLength, ResultPoint, TheListHandle);
  404.     StringPointer := Ptr(Ord(@ResultString));
  405.     StringPointer^ := StringLength;
  406.     ListSelection := ResultString;
  407.    end
  408.   else  {Otherwise, return the empty string to show that nothing is selected.}
  409.    ListSelection := '';
  410.  end;
  411.  
  412. {Add a new cell containing the string parameter to the end of the list}
  413.  procedure AddCell;
  414.   var
  415.    Counter: Integer;
  416.    CellPoint: Point;
  417.    OldString: Str255;
  418.    CompResult: Integer;
  419.    StringLength: Integer;
  420.    StringPointer: Ptr;
  421.    done: Boolean;
  422.  begin
  423. {Step 1:  Circle through the loop and figure out where we should insert
  424. the new}
  425. {cell.  We do this to put the list in alphabetical order, and to keep it
  426. that way as}
  427. {new items are added.}
  428.   CellPoint.h := 0;
  429.   CellPoint.v := 0;
  430.   Done := false;
  431.   while not done do
  432.    begin
  433.     if LNextCell(TRUE, TRUE, CellPoint, TheListHandle) then
  434.      begin
  435.       StringPointer := Ptr(Ord(@OldString) + 1);
  436.       StringLength := 255;  {This is the maximum amount of data we are
  437. allowed to move.}
  438.       LGetCell(StringPointer, StringLength, CellPoint, TheListHandle);
  439.       StringPointer := Ptr(Ord(@OldString));
  440.       StringPointer^ := StringLength;
  441. {Now, compare the new string with the contents of the cell and decide
  442. whether the new string}
  443. {should come before or after this cell.}
  444.       CompResult := RelString(NewString, OldString, false, true);
  445.       case CompResult of
  446.        sortsBefore, sortsEqual: 
  447.        done := true;
  448.        SortsAfter: 
  449.        ;
  450.       end;
  451.      end
  452.     else
  453. {There are no more rows, so that's all.}
  454.      begin
  455.       done := true;
  456.      end;
  457.    end;
  458.  
  459. {Add the new row at the top of the list.}
  460.   CellPoint.v := LAddRow(1, CellPoint.v, TheListHandle);
  461. {Put the string into the cell.  Once again, there ought to be an easier
  462. way to do this.}
  463.   LSetCell(Pointer(Ord(@NewString) + 1), Length(NewString), CellPoint,
  464. TheListHandle);
  465.  end;
  466.  
  467.  
  468.  procedure RenameCell;
  469.   var
  470.    CellPoint: Point;
  471.    DataPtr: Ptr;
  472.    DataLen: Integer;
  473.  begin
  474.   SetPt(CellPoint, 0, 0);
  475.   DataPtr := Pointer(Ord(@OldString) + 1);
  476.   dataLen := Length(OldString);
  477.   if LSearch(dataPtr, dataLen, nil, CellPoint, TheListHandle) then
  478.    begin
  479.     DataPtr := Pointer(Ord(@NewString) + 1);
  480.     dataLen := Length(NewString);
  481.     LSetCell(DataPtr, dataLen, CellPoint, TheListHandle);
  482.    end
  483.   else
  484.    begin
  485. {The programmer asked us to rename a cell which doesn't exist.  We'll just
  486. beep angrily}
  487. {three times.  It's the programmer's responsibility to see that the cell
  488. in question actually}
  489. {does exist before calling this routine.}
  490.     Sysbeep(1);
  491.     Sysbeep(1);
  492.     Sysbeep(1);
  493.    end;
  494.  end;
  495.  
  496.  
  497. {Remove the cell with the given name from the list.}
  498.  procedure DeleteCell;
  499.   var
  500.    CellPoint: Point;
  501.    DataPtr: Ptr;
  502.    DataLen: Integer;
  503.  begin
  504.   SetPt(CellPoint, 0, 0);
  505.   DataPtr := Pointer(Ord(@TheString) + 1);
  506.   dataLen := Length(TheString);
  507.   if LSearch(dataPtr, dataLen, nil, CellPoint, TheListHandle) then
  508.    begin
  509.     LDelRow(1, CellPoint.v, TheListHandle);
  510.    end
  511.   else
  512.    begin
  513. {The programmer asked us to delete a cell which doesn't exist.  We'll just
  514. beep angrily}
  515. {three times.  It's the programmer's responsibility to see that the cell
  516. in question actually}
  517. {does exist before calling this routine.}
  518.     Sysbeep(1);
  519.     Sysbeep(1);
  520.     Sysbeep(1);
  521.    end;
  522.  end;
  523.  
  524. {Get rid of the list when we're done with it, cleaning up all the memory.}
  525.  procedure DisposList;
  526.  begin
  527.   LDispose(TheListHandle);
  528.  end;
  529.  
  530.  
  531. end.
  532.  
  533. ---------------------------
  534.  
  535. From: tomc@oakhill.sps.mot.com (Tom Cunningham)
  536. Subject: Need sample code of MPW tool using Apple Events
  537. Date: 17 Sep 92 18:18:19 GMT
  538. Organization: Motorola Inc., Austin, Tx
  539.  
  540.  
  541. Does anyone have some code for an MPW tool using Apple Events that
  542. they could send me?  In particular, I want to communicate with the
  543. Tool Server (e.g. run a script) via Apple Events from within an MPW
  544. tool.  Thanks.
  545. - -- 
  546. Tom Cunningham  Motorola Inc.  Austin TX
  547. tomc@dsp.sps.mot.com
  548. cs.utexas.edu!oakhill!dsp!bouwsma!tomc
  549.  
  550. +++++++++++++++++++++++++++
  551.  
  552. From: keith@taligent.com (Keith Rollin)
  553. Organization: Taligent
  554. Date: Fri, 18 Sep 1992 01:50:18 GMT
  555.  
  556. In article <1992Sep17.181819.23018@oakhill.sps.mot.com>,
  557. tomc@oakhill.sps.mot.com (Tom Cunningham) wrote:
  558. > Does anyone have some code for an MPW tool using Apple Events that
  559. > they could send me?  In particular, I want to communicate with the
  560. > Tool Server (e.g. run a script) via Apple Events from within an MPW
  561. > tool.  Thanks.
  562.  
  563. I used the following in a tool I wrote to kill and restart the Finder. This
  564. was in the hopes that shutting down the Finder would help speed up my long
  565. compiles (it didn't). Remember that you have to have one of the MPW Shells
  566. that comes with its High-Level Event Aware bit set:
  567.  
  568. void KillFinder()
  569. {
  570.     OSErr            err;
  571.     OSType            signature = 'MACS';
  572.     AEAddressDesc    target;
  573.     AppleEvent        theEvent;
  574.     Str255            s;
  575.     ProcessSerialNumber    pPsn;
  576.     
  577.     err = FindProcessBySignature(signature, &pPsn);
  578.     if (err == noErr) {
  579.         err = AECreateDesc(typeProcessSerialNumber, (Ptr) &pPsn, sizeof(pPsn),
  580. &target);
  581.         if (err == noErr) {
  582.             err = AECreateAppleEvent('aevt', 'quit', &target,
  583.                                         kAutoGenerateReturnID, kAnyTransactionID, &theEvent);
  584.             if (err == noErr) {
  585.                 err = AESend(&theEvent, nil, kAENoReply, kAENormalPriority, kNoTimeOut,
  586. nil, nil);
  587.                 if (err != noErr) {
  588.                     fprintf(stderr, "### - Error while trying to send Apple Event.\n");
  589.                     GetSysErrText(err, s);
  590.                     fprintf(stderr, "### %s.\n", s);
  591.                     exit(kBadAESend);
  592.                 }
  593.             } else {
  594.                 fprintf(stderr, "### - Error while trying to create Apple Event.\n");
  595.                 GetSysErrText(err, s);
  596.                 fprintf(stderr, "### %s.\n", s);
  597.                 exit(kBadAppleEvent);
  598.             }
  599.         } else {
  600.             fprintf(stderr, "### - Error while trying to create Finder address.\n");
  601.             GetSysErrText(err, s);
  602.             fprintf(stderr, "### %s.\n", s);
  603.             exit(kBadAddress);
  604.         }
  605.     } else {
  606.  
  607. +++++++++++++++++++++++++++
  608.  
  609. From: ksand@apple.com (Kent Sandvik)
  610. Date: 18 Sep 92 22:22:53 GMT
  611. Organization: Apple
  612.  
  613. In article <1992Sep17.181819.23018@oakhill.sps.mot.com>,
  614. tomc@oakhill.sps.mot.com (Tom Cunningham) wrote:
  615. > Does anyone have some code for an MPW tool using Apple Events that
  616. > they could send me?  In particular, I want to communicate with the
  617. > Tool Server (e.g. run a script) via Apple Events from within an MPW
  618. > tool.  Thanks.
  619.  
  620. The System 7 CD had an MPW tool called SendAE that you could use.
  621. The AEs for Toolserver are documented in the Toolserver Release
  622. Notes.
  623.  
  624. Finally, the Developer CD should have a lot of small AE snippets
  625. could reused for AE code.
  626.  
  627. Kent/DTS
  628.  
  629. "You should really just relax" -MST3K
  630. - -------------------
  631. Kent Sandvik (UUCP: ....!apple!ksand; INTERNET: ksand@apple.com)
  632. DISCLAIMER: Private activities on the Net.
  633.  
  634. ---------------------------
  635.  
  636. From: mxmora@unix.sri.com (Matthew Xavier Mora)
  637. Subject: What is the bandwidth of a CableTV channel?
  638. Date: 17 Sep 92 17:51:58 GMT
  639. Organization: SRI International
  640.  
  641. This question probably doesn't belong here but I figure this is the
  642. smartest group on the net anyway so you might know. :-)
  643.  
  644. What is the bandwidth of a cable tv channel and could ethernet pass through
  645. it? How about appletalk? You see what I'm getting at don't you. :-)
  646.  
  647. Thanks
  648.  
  649. Matt
  650.  
  651. +++++++++++++++++++++++++++
  652.  
  653. From: Anders Wallgren <anders@verity.com>
  654. Organization: Verity, Mountain View, CA, USA
  655. Date: Fri, 18 Sep 92 03:18:52 GMT
  656.  
  657. In article <mxmora-170992105130@css-mac1.sri.com> Matthew Xavier
  658. Mora, mxmora@unix.sri.com writes:
  659. >What is the bandwidth of a cable tv channel and could ethernet
  660. pass through
  661. >it? How about appletalk? You see what I'm getting at don't you. :-)
  662.  
  663. Well, one NTSC TV channel is 6MHz, so assume a 100 channel capacity
  664. (perhaps generous, but it makes the math easier), which means
  665. something like 600MHz.
  666.  
  667. anders
  668.  
  669. +++++++++++++++++++++++++++
  670.  
  671. From: beckett@ctrvax.vanderbilt.edu (Robert Beckett)
  672. Date: 18 Sep 92 16:32:35 GMT
  673. Organization: Vanderbilt University Computer Center
  674.  
  675. In article <mxmora-170992105130@css-mac1.sri.com>, mxmora@unix.sri.com
  676. (Matthew Xavier Mora) wrote:
  677. > This question probably doesn't belong here but I figure this is the
  678. > smartest group on the net anyway so you might know. :-)
  679. > What is the bandwidth of a cable tv channel and could ethernet pass through
  680. > it? How about appletalk? You see what I'm getting at don't you. :-)
  681.  
  682. On our braodband, cable TV and data channels co-exist.  Cable TV channels
  683. are 6Mhz wide.  We have AppliTeks which have send and receive channels,
  684. each of which is 6Mhz wide.  We also have Chipcoms which use 12Mhz channels
  685. that somehow manage to send and receive.  So it appears that if you wish to
  686. do full ethernet on cable, you need to set aside 2 cable channels to do it.
  687.  I am no networking expert, but this is my understanding of the situation
  688. here.
  689.  
  690. I am reminded somehow of the old Sony PCM F1 digital audio processor, which
  691. allowed one to record full 16bit/44.056Khz 2 channel audio (about 1.4 Mb/s)
  692. onto regular VHS or Beta VCR's.  Of course, Ethernet (at 10 Mb/s) is much
  693. faster.
  694.  
  695.  
  696. - --Robert    BECKETT@ctrvax.vanderbilt.edu
  697.             Vanderbilt University Computer Center
  698.  
  699. +++++++++++++++++++++++++++
  700.  
  701. From: potts@itl.itd.umich.edu (Paul Potts)
  702. Date: 18 Sep 92 20:10:16 GMT
  703. Organization: Instructional Technology Laboratory, University of Michigan
  704.  
  705. In article <beckett-180992111912@sdvmac1.cc.vanderbilt.edu> beckett@ctrvax.vanderbilt.edu (Robert Beckett) writes:
  706. >In article <mxmora-170992105130@css-mac1.sri.com>, mxmora@unix.sri.com
  707. >(Matthew Xavier Mora) wrote:
  708. >> 
  709. >> This question probably doesn't belong here but I figure this is the
  710. >> smartest group on the net anyway so you might know. :-)
  711. >> 
  712. >> What is the bandwidth of a cable tv channel and could ethernet pass through
  713. >> it? How about appletalk? You see what I'm getting at don't you. :-)
  714. >> 
  715. >
  716. >On our braodband, cable TV and data channels co-exist.  Cable TV channels
  717. >are 6Mhz wide.  We have AppliTeks which have send and receive channels,
  718. >each of which is 6Mhz wide.  We also have Chipcoms which use 12Mhz channels
  719. >that somehow manage to send and receive.  So it appears that if you wish to
  720. >do full ethernet on cable, you need to set aside 2 cable channels to do it.
  721. > I am no networking expert, but this is my understanding of the situation
  722. >here.
  723.  
  724. We had a similar system back at the College of Wooster... there was a
  725. cable TV plant campus-wide, and ChipCom boxes which passed Ethernet
  726. over a couple of channels of the cable TV plant. It can be done without
  727. too much trauma, although as I recall the boxes were quite expensive.
  728. I don't know what the performance of the ChipComs were (they were called
  729. EtherModems, I believe) but there didn't seem to be any noticeable bottleneck
  730. when going from an Ethernet over the cable plant and back to another Ethernet.
  731.  
  732.  
  733. - -- 
  734. "...remove protective cap. Hold atomizer with thumb at base and nozzle 
  735. between first and second fingers. Without tilting head, insert nozzle into 
  736. nostril. Fully depress rim with a firm, even stroke and sniff deeply."
  737. - -advice for presidential candidates from Paul Potts - potts@itl.itd.umich.edu
  738.  
  739. +++++++++++++++++++++++++++
  740.  
  741. From: lederman@taney.uscghq.uscg.mil
  742. Date: 18 Sep 92 14:19:01 GMT
  743. Organization: United States Coast Guard
  744.  
  745. In article <mxmora-170992105130@css-mac1.sri.com>, mxmora@unix.sri.com (Matthew Xavier Mora) writes:
  746. > What is the bandwidth of a cable tv channel and could ethernet pass through
  747. > it? How about appletalk? You see what I'm getting at don't you. :-)
  748.  
  749.     The bandwidth of a single TV channel (cable, or anywhere else)
  750.  is 6 MHz.  The bandwidth of the entire cable system is severawl
  751.  hundred MHz.
  752.  
  753.     Ethernet is up to 10 million bits per second.  There are
  754.  already companies which make "translators" to transport ethernet
  755.  on a Cable TV cable.  I think it uses more than one channel.
  756.  
  757.     Appletalk on a local talk cable is somwhere around 233 k BPS. 
  758.  I don't know any commercial hardware to transport it on a cable
  759.  network, but there may well be some.  (I built some hardware that
  760.  would do stuff like this for my Masters of Engineering degree,
  761.  but it never went commercial :-).  I'm sure there is stuff to put
  762.  medium speed channels on a Cable, but they're going to be in
  763.  standard multiples (like 64k BPS, or 256k BPS).
  764.  
  765. ---------------------------
  766.  
  767. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  768. Subject: PaintBehind (was Re: NON-QUICKDRAW GAMES)
  769. Date: 19 Sep 92 06:11:52 GMT
  770. Organization: University of Waikato, Hamilton, New Zealand
  771.  
  772. In article <18qmi7INN12l@agate.berkeley.edu>, deadman@garnet.berkeley.edu (Ben Haller) writes:
  773. > In article <1992Sep11.184049.10764@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  774. >>In article <18one7INNm74@agate.berkeley.edu>, deadman@garnet.berkeley.edu (Ben Haller) writes:
  775. >>> In article <ah5ywvd@rpi.edu> johnsd2@rpi.edu writes:
  776. >>> void InvalScreen()
  777. >>> {
  778. >>>     DrawMenuBar();
  779. >>>     PaintOne(0L,GrayRgn);
  780. >>>     PaintBehind(WindowList,GrayRgn);
  781. >>> }
  782. >>
  783. >>The PaintOne call is redundant; PaintBehind does it all. Also, why refer
  784. >>to the WindowList when you can use FrontWindow?
  785. >   The PaintOne call, if I recall correctly, repaints the desktop.  This
  786. > would not be done by the PaintBehind call, as far as I know.
  787.  
  788. I have an FKEY installed on my machine for refreshing the screen. It
  789. basically does a PaintBehind call. I never bothered with DrawMenuBar, since
  790. the menu bar gets redrawn on a major switch anyway.
  791.  
  792. Every time I invoke this FKEY, I can see the Finder redrawing the icons on
  793. the desktop.
  794.  
  795. Here, try it yourself:
  796.  
  797. (This file must be converted with BinHex 4.0)
  798.  
  799. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  800. Computer Services Dept                     fax: +64-7-838-4066
  801. University of Waikato            electric mail: ldo@waikato.ac.nz
  802. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  803.  
  804. +++++++++++++++++++++++++++
  805.  
  806. From: deadman@garnet.berkeley.edu (Ben Haller)
  807. Date: 18 Sep 92 17:04:59 GMT
  808. Organization: Stick Software
  809.  
  810. In article <1992Sep18.181152.10862@waikato.ac.nz>
  811.   ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  812. [several levels of quoting and attribution have been removed; not all
  813. of this was written by Lawrence, some was written by me...]
  814. > void InvalScreen()
  815. > {
  816. >     DrawMenuBar();
  817. >     PaintOne(0L,GrayRgn);
  818. >     PaintBehind(WindowList,GrayRgn);
  819. > }
  820. >
  821. >I have an FKEY installed on my machine for refreshing the screen. It
  822. >basically does a PaintBehind call. I never bothered with DrawMenuBar, since
  823. >the menu bar gets redrawn on a major switch anyway.
  824. >
  825. >Every time I invoke this FKEY, I can see the Finder redrawing the icons on
  826. >the desktop.
  827.  
  828.   Maybe the PaintOne is needed in System 6; this makes sense, since in
  829. System 7 the Desktop is really a window in the windowlist of the Finder.
  830. So I bet your FKEY wouldn't work in System 6.0.x (but I can't try it,
  831. not having a machine to try it on... anyone want to check & make sure?)
  832.   I really feel fairly sure that the PaintOne is necessary for some
  833. reason...
  834.   As for the DrawMenuBar call, well, not everyone calls this function
  835. immediately before generating a major context switch... screensavers
  836. being a good example...
  837.  
  838. - -Ben Haller (deadman@garnet.berkeley.edu)
  839.  
  840. ---------------------------
  841.  
  842. From: rer@sun1x.res.utc.com (Rick E Romkey)
  843. Subject: List fields...
  844. Date: 17 Sep 92 12:06:45 GMT
  845. Organization: United Technologies Research Center
  846.  
  847.  
  848. I have been having some problems trying to figure out how
  849. to get a custom List working.  Here's the scoop:
  850.  
  851. I wanna place a '\n' delimited string into a field as separate
  852. cells.  It should only allow a single field to be selected.  I seem
  853. to have created the cells ok, but for the life of me, I can't
  854. get it to write within them.
  855.  
  856. This field is part of a modal dialog (maybe a modeless someday,
  857. but for now I'll be happy with a modal).   Anyone have some
  858. easy-to-follow source code?
  859.  
  860. Rick E Romkey
  861.  
  862. +++++++++++++++++++++++++++
  863.  
  864. From: haynes@mace.cc.purdue.edu (Carl W. Haynes III)
  865. Date: 19 Sep 92 00:21:26 GMT
  866. Organization: Purdue University
  867.  
  868. In article <1992Sep17.120645.19976@sun1x.actc.res.utc.com> rer@sun1x.res.utc.com (Rick E Romkey) writes:
  869. >
  870. >I wanna place a '\n' delimited string into a field as separate
  871. >cells.  It should only allow a single field to be selected.  I seem
  872. >to have created the cells ok, but for the life of me, I can't
  873. >get it to write within them.
  874. >
  875.  
  876. In your LDEF Proc, you do all your drawing in when you get
  877. the lDrawMsg. lRect gives you the rect to draw into. to get the
  878. text of the cell you want to draw.
  879.  
  880. here's an example LDEF that simply makes sure that the text is drawn
  881. in 12 point applFont. I ripped out a bunch of code that was specific
  882. to my application (I was doing some extra formatting), but everything 
  883. should still work.
  884.  
  885. Macintosh Programming Secrets (2nd edition) also has an example LDEF.
  886. I've always found the List Manager chapter of Inside Mac one of
  887. the better writtendefinately read through that again.
  888. The UseNet Macintosh Programmers Guide (available at the usual archives)
  889. also has an example LDEF.
  890.  
  891. carl
  892.  
  893. pascal void exampleLDEF( short       lMessage, 
  894.                          Boolean     lSelect, 
  895.                          Rect        *lRect, 
  896.                          Cell        *lCell,
  897.                          short       lDataOffset,
  898.                          short       lDataLen,
  899.                          ListHandle  lHandle)
  900. {
  901. char    listState;
  902.  
  903.    listState = HGetState(lHandle);
  904.    HLock(lHandle);
  905.  
  906.    switch (lMessage)
  907.    {
  908.       case lInitMsg:
  909.          break;
  910.       case lDrawMsg:
  911.       {
  912.       Rect          tempRect;
  913.       PenState      savedPenState;
  914.       short         savedFont;
  915.       short         savedFontSize;
  916.       Str255        cellContents;
  917.         
  918.          //
  919.          //    Save everything we can since we don't know
  920.          //    what we may be dealing with
  921.          //
  922.             
  923.          GetPenState(&savedPenState);
  924.          PenNormal();
  925.             
  926.          savedFont = (*(**lHandle).port).txFont;
  927.          savedFontSize = (*(**lHandle).port).txSize;
  928.             
  929.          //
  930.          //    Set up things the way we like 'em
  931.          //
  932.             
  933.          TextFont(applFont);
  934.          TextSize(12);
  935.  
  936.          EraseRect(lRect);
  937.                         
  938.          //
  939.          //    Write the text
  940.          //
  941.             
  942.          BlockMove( &*(**lHandle).cells[0] + lDataOffset, 
  943.                     cellContents, 
  944.                     (Size)lDataLen);
  945.  
  946.          tempRect = *lRect;
  947.          InsetRect(&tempRect, 2, 0);
  948.          TextBox(cellContents, (long)lDataLen, &tempRect, teJustLeft);
  949.             
  950.          //
  951.          //    Invert it if necessary
  952.          //
  953.             
  954.          if (lSelect)
  955.             InvertRect(lRect);
  956.             
  957.          //
  958.          //    Set everything back
  959.          //
  960.             
  961.          TextFont(savedFont);
  962.          TextSize(savedFontSize);
  963.          SetPenState(&savedPenState);
  964.  
  965.          break;
  966.       }
  967.       case lHiliteMsg:
  968.          InvertRect(lRect);
  969.          break;
  970.    }
  971.     
  972.    HSetState(lHandle, listState);
  973. }
  974.  
  975. ---------------------------
  976.  
  977. From: bberqu@sagpd1
  978. Subject: Color Icons
  979. Date: 26 Aug 92 23:38:00 GMT
  980.  
  981. Hi,
  982.  
  983. I'm trying to create some color icons using ResEdit in 256 color mode, so
  984. I create the Icons with certain colors (like yellows/oranges ...) just 
  985. fine, I copy them to the scrap and then paste them into the getinfo 
  986. window, however, most of the (if not all) orange/yellow colors don't
  987. show up when the icon is pasted, all shades of the blues show up just
  988. fine.  I also tried the apple colors pallete in ResEdit also with oranges 
  989. and reds, still no success.  I hope this isn't a FAQ, Any explanations 
  990. would be appreciated.
  991.  
  992. Programmers question:
  993.  
  994. I'm trying to use ModalDialog with a filterProc function which will
  995. handle popupmenus,  when I call ModalDialog and just let it sit there
  996. no mouse movement or anything, after a while, I get, I believe a system
  997. error #26 according to MacsBug, all my filter proc function does is 
  998. return (TRUE), I've also tried FALSE.  My impression from IM is that
  999. ModalDialog sits there and waits for a mousedown event within the dialog
  1000. and when it gets either a itemhit or incontent or whatever, it then calls 
  1001. the filterProc function (if defined), is this true? I assume that it 
  1002. passes the dialog poointer/event record pointer/itemhit pointer, is this 
  1003. true?  It looks like its calling my filterProc constantly, if this is true 
  1004. do I need handle events within the filterProc?  Assuming all my parameters
  1005. are correct for filterProc are correct, what am I doing wrong?
  1006.  
  1007. An explanation of how ModalDialog and the filterProc functions work with
  1008. each other would be nice.
  1009.  
  1010. Thanks in advance
  1011.  
  1012. Brian
  1013.  
  1014. +++++++++++++++++++++++++++
  1015.  
  1016. From: stepan@natinst.com (Stepan Riha)
  1017. Date: 27 Aug 92 15:32:56 GMT
  1018. Organization: National Instruments, Austin, TX
  1019.  
  1020. In article <1992Aug26.233800.21347@sagpd1> bberqu@sagpd1 () writes:
  1021.  
  1022. Q: Why does the finder change some colors when you paste a picture into the
  1023.    Get Info Window?
  1024.  
  1025. When you paste a picture into the Get Info Window the finder maps the colors
  1026. to the 34 Apple Icon Colors.  You can set these in the cicn or icl8 dialog.
  1027. If you REALLY want to have your specific colors, you can edit the custom icons
  1028. directly in ResEdit once you paste them on your document in the GetInfo window.
  1029. The icons have id -16455 and type icl8, icl4, ICN#, ics8, etc.
  1030. Note that only colors from the Apple Icon Colors will by affected by the
  1031. color of a label or when the icon is selected.
  1032.  
  1033.     - Stepan
  1034. - -- 
  1035.    Stepan Riha -- stepan@natinst.com
  1036.  
  1037. +++++++++++++++++++++++++++
  1038.  
  1039. From: potts@itl.itd.umich.edu (Paul Potts)
  1040. Date: 27 Aug 92 15:43:37 GMT
  1041. Organization: Instructional Technology Laboratory, University of Michigan
  1042.  
  1043. In article <1992Aug26.233800.21347@sagpd1> bberqu@sagpd1 () writes:
  1044. ... stuff on color icons left out...
  1045. >
  1046. >Programmers question:
  1047. >
  1048. >I'm trying to use ModalDialog with a filterProc function which will
  1049. >handle popupmenus,  when I call ModalDialog and just let it sit there
  1050. >no mouse movement or anything, after a while, I get, I believe a system
  1051. >error #26 according to MacsBug, all my filter proc function does is 
  1052. >return (TRUE), I've also tried FALSE.  My impression from IM is that
  1053. >ModalDialog sits there and waits for a mousedown event within the dialog
  1054. >and when it gets either a itemhit or incontent or whatever, it then calls 
  1055. >the filterProc function (if defined), is this true? 
  1056.  
  1057. Not quite. When you set up a filter procedure, ModalDialog 
  1058. sends all the events to it for screening before it looks at them. 
  1059. This includes idle events, if there are any: you can actually do things
  1060. on idle time in your filter procedure, if you don't need any guarantee that
  1061. you will get idle time (you wont' get it in a very busy system, at least
  1062. not consistently).
  1063.  
  1064. ModalDialog *always* quits when it gets one of its triggering events,
  1065. like a keypress that it understands (return for the default button, for
  1066. example), or a mouse click in a button or on a checkbox. If you have, say,
  1067. ten check boxes and an OK button, and you want to keep the modal dialog up
  1068. until the OK button is hit, you have to call ModalDialog in a loop which
  1069. checks to see what was hit and only stops calling it if the OK button was
  1070. hit.
  1071.  
  1072. If you install a filter procedure, you return TRUE if you want ModalDialog
  1073. to quit. You have the event that got passed to your filter proc, so you
  1074. can change it if you want. You have a pointer to the item ID that ModalDialog
  1075. should return. Here's a diagram:
  1076.  
  1077. Without a filter proc (actually with the default filter proc)
  1078.  
  1079. - ---> event--->   ModalDialog  ---------> exit (return the item that was hit
  1080.                  Was a triggering              to dismiss the dialog)
  1081.                  event received?
  1082.                  
  1083.  
  1084. With a filter proc
  1085.  
  1086. - ---> event---> FilterProc ----> ModalDialog ----> exit (return the item that
  1087.                look at the       Did filterProc         was hit to dismiss the
  1088.                event; return     send "True?"           dialog)
  1089.                TRUE to tell      If so, dismiss
  1090.                ModalDialog that  the dialog.
  1091.                this was a        Otherwise, handle
  1092.              "triggering event", the event.
  1093.                otherwise return  
  1094.                false. 
  1095.  
  1096. No doubt someone will have a correction or two to add to the above, but
  1097. it should give you the general idea.
  1098.  
  1099. Here's an example: if you want your filter procedure to do something
  1100. on its own when the dialog is passed an update event, code it like this:
  1101.  
  1102. (fragment from a filter procedure)
  1103.  
  1104. switch (theEvent->what)
  1105. {
  1106.     case (updateEvt):
  1107.     HandleUpdate(theDialog);
  1108.     return FALSE;
  1109. /*Do not return an item hit value.  Returning
  1110. FALSE tells modalDialog to handle the update
  1111. event.  We have just added our own handling
  1112. of the event. */
  1113.     break;    
  1114.  
  1115. where "HandleUpdate" is a routine of mine that draws on the dialog.
  1116. Note that if your filter proc handles the event fully, and you don't want
  1117. ModalDialog to even see it, you can clear the event, although this generally
  1118. shouldn't be necessary since ModalDialog has useful default reactions to
  1119. most events.
  1120.  
  1121. >I assume that it 
  1122. >passes the dialog poointer/event record pointer/itemhit pointer, is this 
  1123. >true?  It looks like its calling my filterProc constantly, if this is true 
  1124. >do I need handle events within the filterProc?  Assuming all my parameters
  1125. >are correct for filterProc are correct, what am I doing wrong?
  1126.  
  1127. It is calling your filterProc constantly: every event goes through it. 
  1128.  
  1129. >
  1130. >An explanation of how ModalDialog and the filterProc functions work with
  1131. >each other would be nice.
  1132. >
  1133. >Thanks in advance
  1134.  
  1135. I hope this helps some with your understanding of modal dialogs. I'm not
  1136. sure how you should go about supporting a pop-up menu, but I tend to think
  1137. that doing all the mouse tracking in the filter proc is the wrong approach.
  1138. I was under the impression that there was pop-up support in the OS now.
  1139. Can anyone confirm or deny? If not you may want to build a window and
  1140. handle your own events from scratch, track the control, etc.
  1141.  
  1142. >
  1143. >Brian
  1144.  
  1145.  
  1146. - -- 
  1147. "It'sVerySad / toSeeTheAncientAndDistinguishedGameThatUsedToBe / aModelOf
  1148. DecorumAndTranquilityBecomeLikeAnyOtherSportABattlegroundForRivalIdeologies
  1149. toSlugItOutWithGlee." (from _Chess_). -potts@itl.itd.umich.edu-
  1150.  
  1151. +++++++++++++++++++++++++++
  1152.  
  1153. From: walkerj@math.scarolina.edu (Jim Walker)
  1154. Date: 27 Aug 92 19:36:41 GMT
  1155. Organization: USC  Department of Computer Science
  1156.  
  1157. In <1992Aug26.233800.21347@sagpd1> bberqu@sagpd1 () writes:
  1158. ...
  1159. >I'm trying to use ModalDialog with a filterProc function which will
  1160. >handle popupmenus,  when I call ModalDialog and just let it sit there
  1161. >no mouse movement or anything, after a while, I get, I believe a system
  1162. >error #26 according to MacsBug, all my filter proc function does is 
  1163. ...
  1164.  
  1165. (Tried to mail, but it bounced.)
  1166.  
  1167. You sure it wasn't error 28, stack collides with heap?  That's probably
  1168. what would happen if you were using C and forgot to declare the filterProc
  1169. using the 'pascal' keyword, because ModalDialog would expect the filterProc
  1170. to clean up the stack after itself, and a C routine expects the caller to
  1171. clean up the stack.
  1172. - --
  1173.  
  1174.  -- Jim Walker  USC Dept. of Math.  walkerj@math.scarolina.edu
  1175.  
  1176. +++++++++++++++++++++++++++
  1177.  
  1178. From: jeremyr@dcs.qmw.ac.uk (Jeremy Roussak)
  1179. Date: 28 Aug 92 19:56:51 GMT
  1180. Organization: Computer Science Dept, QMW, University of London
  1181.  
  1182. In <1992Aug26.233800.21347@sagpd1> bberqu@sagpd1 writes:
  1183.  
  1184. >I'm trying to use ModalDialog with a filterProc function which will
  1185. >handle popupmenus,  when I call ModalDialog and just let it sit there
  1186. >no mouse movement or anything, after a while, I get, I believe a system
  1187. >error #26 according to MacsBug, all my filter proc function does is
  1188. >return (TRUE), I've also tried FALSE.
  1189.  
  1190. 1. You are programming in C
  1191. 2. You have forgotten to declare your filterproc as "pascal"
  1192. 3. The error is really 28
  1193.  
  1194. Just a wild guess...
  1195.  
  1196. Jeremy
  1197.  
  1198. +++++++++++++++++++++++++++
  1199.  
  1200. From: cent@u.washington.edu  (bob cent)
  1201. Organization: university of washington
  1202. Date: Fri, 18 Sep 1992 22:59:30 GMT
  1203.  
  1204. I would like to learn how to change my b/w application icons to color, but have
  1205. not found a good receipe to follow.  I've fiddled a bit with 'cicn', but had no
  1206. luck.  Also, do the color icons work on os6 as well as os7?
  1207.  
  1208. Thanks.
  1209.  
  1210. Bob Cent, Engineering Technician
  1211. cent@u.washington.edu
  1212. Seattle, Washington
  1213.  
  1214.  
  1215.  
  1216. ---------------------------
  1217.  
  1218. End of C.S.M.P. Digest
  1219. **********************
  1220.